<?php

namespace App\Http\Resources\Front;

use Illuminate\Http\Resources\Json\Resource;

class User extends Resource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function toArray($request)
    {
        return [
            'id' => $this->id,
            'name' => $this->name,
            'email' => $this->email,
            'openid' => $this->openid,
            'realname' => $this->realname,
            'idcard' => idcard_asterisk($this->idcard),
            'telphone' => mobile_asterisk($this->telphone),
            'avatar' => $this->avatar,
            'address' => $this->address,
            'address' => $this->address,
            'address' => $this->address,
            'check' => $this->check,
            'ent_check' => $this->ent_check,
            'idcard_pic' => $this->idcard_pic,
            'biz_lic_pic' => $this->biz_lic_pic,
            'bank_card' => bankcard_asterisk($this->bank_card), 
            'hasstore' => $this->hasstore,
            'unionid' => $this->unionid,
            'created_at' => $this->created_at->format('Y-m-d H:m:s')
        ];
    }
}